import request from '@/utils/request'

// 查询服务订单列表
export function listServiceOrder(query) {
  return request({
    url: '/biz/serviceOrder/list',
    method: 'get',
    params: query
  })
}

// 查询服务订单列表-客服派单
export function dispatchList(query) {
  return request({
    url: '/biz/serviceOrder/dispatchList',
    method: 'get',
    params: query
  })
}

// 查询服务订单详细
export function getServiceOrder(id) {
  return request({
    url: '/biz/serviceOrder/' + id,
    method: 'get'
  })
}

// 新增服务订单
export function addServiceOrder(data) {
  return request({
    url: '/biz/serviceOrder',
    method: 'post',
    data: data
  })
}

// 修改服务订单
export function updateServiceOrder(data) {
  return request({
    url: '/biz/serviceOrder',
    method: 'put',
    data: data
  })
}

// 删除服务订单
export function delServiceOrder(id) {
  return request({
    url: '/biz/serviceOrder/' + id,
    method: 'delete'
  })
}

// 启用禁用服务订单
export function changeStatus(data) {
  return request({
    url: '/biz/serviceOrder/changeStatus',
    method: 'put',
    data: data
  })
}

// 取消订单
export function cancel(id) {
  return request({
    url: '/biz/serviceOrder/cancelOrder/'+id,
    method: 'post',
  })
}

// 派单
export function dispatch(data) {
  return request({
    url: '/biz/serviceOrder/dispatch',
    method: 'post',
    data: data
  })
}
//查询可派单人员
export function getDispatchUserList(query) {
  return request({
    url: '/biz/serviceOrder/getDispatchUserList',
    method: 'get',
    params: query
  })
}

// 客服代下单
export function createHelpCustomerOrder(data) {
  return request({
    url: '/biz/serviceOrder/helpCustomerOrder',
    method: 'post',
    data: data
  })
}
